package com.neomanager.admin.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class MenuDao extends SqlMapClientDaoSupport 
{
	public Logger logger = Logger.getLogger(this.getClass());

	/**
	 * 메뉴 목록
	 */
	public ArrayList<Map<String, Object>> selectMenuInfo() throws DataAccessException
	{
		logger.info("메뉴목록 DAO");
		@SuppressWarnings("unchecked")
		ArrayList<Map<String, Object>> mlist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("menu.selectMenuInfo");
        return mlist;
	}
	
	/**
	 *  메뉴 정보 리스트
	 */
	public ArrayList<Map<String, Object>> selectMenuInfoList(List<Object> param) throws DataAccessException
	{
		logger.info("메뉴 정보 리스트 DAO");
		@SuppressWarnings("unchecked")
		ArrayList<Map<String, Object>> mlist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("menu.selectMenuInfoList",param);
		return mlist;
	}

	/**
	 * 메뉴 등록
	 */
	public void insertMenuInfo(Map<String, Object> param) throws DataAccessException
	{
		logger.info("메뉴 등록 DAO");
		getSqlMapClientTemplate().insert("menu.insertMenuInfo", param);
        return;
	}

	/**
	 * 메뉴 수정
	 */	
	public void updateMenuInfo(Map<String, Object> param) throws DataAccessException {
		logger.info("메뉴 수정 DAO");
		getSqlMapClientTemplate().update("menu.updateMenuInfo", param);
        return;
	}

	/**
	 * 메뉴 삭제
	 */	
	public void deleteMenuInfo(Map<String, Object> param) throws DataAccessException {
		logger.info("메뉴 삭제 DAO");
		getSqlMapClientTemplate().update("menu.deleteMenuInfo", param);
        return;
	}	
	
}
